<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.framework');


preg_match( '/img(.*?)src\=\"(.*?)\"/', $this->item->introtext, $match );			
$result = isset($match[2]) ? $match[2] : "";

?>

<div class="news-item">
	<?php if($result != "") { ?>
		<div class="image-intro">
			<img src="<?php echo $result ?>" width="175" height="109">
		</div>
	<?php } ?>
						<div class="intro-text" <?php if($result == "") echo 'style="width: 100%"' ?>>
							<h5><?php echo $this->escape($this->item->title); ?></h5>
							
							<?php
							$arr = explode(" ", strip_tags($this->item->introtext));
				if(count($arr) >= 26)
				{
					for($i=0; $i < 26; $i++)
					{
						echo $arr[$i]." ";
					}
					echo "...";
				}
				else echo strip_tags($this->item->introtext);
							?>
														
							<br><br>
							<a class="more" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">Đọc thêm &gt;&gt;</a>
						</div>
					</div>
					<div class="clear"></div>


<?php echo $this->item->event->afterDisplayContent; ?>
